#include "SparkUI.h"

#include "background.h"
#include "filewatcher.h"
#include "magicpool.h"

SparkUI::SparkUI(QObject *parent) : QObject(parent)
{

}

SparkUI* SparkUI::getInstance() {
    static SparkUI *m_instance = new SparkUI();
    return m_instance;
}

void SparkUI::registerTypes(QQmlEngine *engine) {
    initializeEngine(engine, _uri);
    registerTypes(_uri);
}

void SparkUI::registerTypes(const char *uri) {
    qmlRegisterType<Background>(uri, _major, _minor, "Background");
    qmlRegisterType<MagicPool>(uri, _major, _minor, "MagicPool");

    // Components
    qmlRegisterType<FileWatcher>(uri, _major, _minor, "FileWatcher");
}

void SparkUI::initializeEngine(QQmlEngine *engine, const char *uri) {
    Q_UNUSED(engine)
}
